import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
// import HelloWorld from "../components/HelloWorld.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/home",
    name: "HelloWorld",
    component: () => import("../components/HelloWorld.vue"),
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../components/About.vue"),
  },
  {
    path: "/resb",
    name: "Resb",
    component: () => import("../components/Resb.vue"),
  },
];

const router = createRouter({
  // history: createWebHistory(process.env.BASE_URL), // process.env.BASE_URL node配置 在node环境里使用环境变量
  history: createWebHistory(import.meta.env.BASE_URL), // import.meta.env.BASE_URL vite配置 在浏览器环境里使用环境变量
  routes,
});

export default router;
